//投递的请求封装
import request from "@/utils/http.ts"

//1.投递岗位
export const addSendAPI = (data: any) => {
    return request({
        url: 'send/addSend',
        method: 'post',
        data: {
            sendJobseekerId: data.sendJobseekerId,//求职者id
            sendEmployerId: data.sendJobEmployerId,//招聘者id
            sendJobId: data.sendJobId,//岗位id
            sendStatus: data.sendStatus,//投递状态
        }
    })
}

//2.查询是否投递过该岗位根据Id
export const isSendJobAPI = (data: any) => {
    return request({
        url: 'send/isSend',
        method: 'post',
        params: {
            sendJobseekerId: data.sendJobseekerId,//求职者id
            sendEmployerId: data.sendJobEmployerId,//招聘者id
            sendJobId: data.sendJobId,//岗位id
        }
    })
}

//3.更新投递状态
export const updateSendStatusAPI = (data: any) => {
    return request({
        url: 'send/updateSendStatus',
        method: 'post',
        params: {
            sendId: data.sendId,//投递id
            sendStatus: data.sendStatus,//投递状态
        }
    })
}

//4.删除投递
export const deleteSendAPI = (data: any) => {
    return request({
        url: 'send/deleteSend',
        method: 'post',
        params: {
            sendId: data.sendId,//投递id
        }
    })
}

//5.分页投递列表
export const pageSendAPI = (data: any) => {
    return request({
        url: 'send/pageSend',
        method: 'post',
        data: {
            pageCurrent: data.pageCurrent,//当前页码
            pageSize: data.pageSize,//每页显示条数
            sendEmployerId: data.sendEmployerId,//招聘者id
            sendStatus: data.sendStatus,//投递状态
            resumeGender:data.resumeGender,
            resumeEducationDegree:data.resumeEducationDegree,
            searchName:data.searchName,
        }
    })
}

//6.根据投递ID查询投递信息
export const getSendByIdAPI = (data: any) => {
    return request({
        url: 'send/getSendById',
        method: 'post',
        params: {
            sendId: data.sendId,//投递id
        }
    })
}
